package com.guos.juc;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * 每一行代码，都是改变世界的力量
 *
 * @author 郭帅
 * @date 2022/7/3 12:15 下午
 */
public class ConditionTest {


    final ReentrantLock lock = new ReentrantLock();
    Condition condition = lock.newCondition();

    public void awaitTest() throws Exception {
        try {
            lock.lock();
            condition.await();
            System.out.println("等待解除");
        } finally {
            lock.unlock();
        }
    }

    public static void main(String[] args) {

    }

}
